
(geom 6 1 2)				; => (1 2 4 8 16 32)

(map - '(1 2 3))			; => (-1 -2 -3)

(map + 
     '(1 2 3)
     '(6 5 4)
     '(1 0 1))				; => (8 7 8)

(map (lambda (n)
       (pad-right '(1 2 3) n 'z))
     '(1 3 5))				; => ((1) (1 2 3) (1 2 3 z z))       

(extend '() 4)				; => (() () () ())

(map 
 (lambda (l)
   (extend l 4))
 '(0 (1) (2 3) (4 5 6) 
     (7 8 9 10) 
     (11 12 13 14 15))) 		

;; => ((0 0 0 0) (1 1 1 1) (2 3 2 3) 
;;     (4 5 6 4) (7 8 9 10) (11 12 13 14))

(extend-all
 '((0)
   (1 2)
   (3 4 5)
   (6 7 8 9)))				

;; => ((0 0 0 0) (1 2 1 2) (3 4 5 3) (6 7 8 9))

(let ((l '(0 1 2 3)))
  (append! l '(4))
  l)					; => (0 1 2 3 4)

(let ((l '()))
  (append! l 4)
  l)					; => ()

(map 
 (lambda (index)
   (ref/wrap '(0 1 2) index))
 '(4 -1 9))				; => (1 2 0)

(ref-right '(0 1 2 3) 1) 	; => 2

(filter-index 
 (lambda (index) (= 0 (modulo index 3))) 
 '(a b c d e f g))			; => (a d g)

(take-cycle 
 '(0 1 2 3 4 5 6 7) 3)			; => (0 3 6)

(cycles '(0 1 2 3 4 5 6 7) 3)	; => ((0 3 6) (1 4 7) (2 5))

(interleave '(a b c) '(1 2 3))	; => (a 1 b 2 c 3)

(interleave '(a b) '(1 2) '(x y)) ; => (a 1 x b 2 y)

(lace '(0) '(a b) '(1 2 3) '(w x y z)) 

;; => (0 a 1 w 0 b 2 x 0 a 3 y 0 b 1 z)

(zip
 '(one two three) 
 '(1 2 3)
 '(odd even odd even odd even odd even)) 

;;  => ((one 1 odd) (two 2 even) (three 3 odd))

(zipL '((1 2) (3 4)))



(flop
 '(1 2 0 3 4 5 6)
 '(x y)
 '(91 92 93))                            

;; => ((1 x 91) (2 y 92) (0 x 93) (3 y 91) (4 x 92) (5 y 93) (6 x 91))

(remove-index even? 
	      '(d c o a g t))	; => (c a t)

(remove-index odd? 
	      '(d c o a g t))	; => (d o g)

(remove-count 
 (lambda (e) (= e 2)) 
 '(0 2 1 2) 1)				; => (0 1 2)

(delete-count 2 '(0 2 1 2) 1 =)	; => (0 1 2)

(rotate '(0 1 2 3) 1)		; => (1 2 3 0)

(rotate-right '(0 1 2 3) 1)	; => (3 0 1 2)

(map/index 
 (lambda (index a b) 
   (list index a b)) 
 '(3 2 1) '(a b c))			; => ((0 3 a) (1 2 b) (2 1 c))

(shuffle '(1 2 3 4 5 6))		; => 

(insert '(0 1 2) 
	(lambda (e) (= e 2))
	'a)			; => (0 1 a 2)

(uniform? number? '())		; => #t
(uniform? number? '(0 2 5 6))	; => #t
(uniform? number? '(0 1 'a 2))	; => #f

(delete-duplicates 
 '(0 2 4 6 8 6 2 10 4))			; => (0 2 4 6 8 10)

(delete-duplicates-left
 '(0 2 4 6 8 6 2 10 4))			; => (0 8 6 2 10 4)

(index-equal 'a 
	     '(0 1 2 3 a 5 6)
	     eq?)			; => 4

(index-equal 'a 
	     '(0 1 2 3 5 6)
	     eq?)			; => #f

(list->delimited-string 
 '(a 4 "str" #\b (a 4 "str" #\b))
 ":")

;; => "a:4:str:b:(a 4 str b)"

(list-set! (list 1 2 3) 1 'a)		; => (1 a 3)

(let ((l (list 1 2 3)))
  (list-set! l 1 'a)
  l)					; => (1 a 3)

(list-set! (list 1 2 3) 3 'a)		; => ERROR

(list-set! (list 1 2 3) -1 'a)	; => ERROR

(splice
 '(1 (2 3) 
     (4 (5 6)) 
     (7 (8 (9)))))			; => (1 2 3 4 (5 6) 7 (8 (9)))

(tabulate* 5 (lambda (i) (- i)))	; => (0 -1 -2 -3 -4)

(port->list read-char 
	    (open-input-string "tester")) ; => (#\t #\e #\s #\t #\e #\r)

(list-read 4 
	   read-char 
	   (open-input-string "tester")) ; => (#\t #\e #\s #\t)

(list-write '(#\t #\e #\s #\t) 
	    write-char
	    (current-output-port))	; => writes 'test'

(map (lambda (l r) (sublist '(0 1 2 3 4 5 6 7) l r))
     '(0 4 5) '(4 5 8))			; => ((0 1 2 3) (4) (5 6 7))

(sublist '(1 2 3 4 5 6 7 8 9 T) 0 5)	; => (1 2 3 4 5)

(substring "123456789T" 0 5)		; => "12345"

(length (repeat '(1 2 3) 0))	; => 0

(length (repeat '(1 2 3) 12))	; => 36

(map singleton? '(s (1 2) (3)))	; => (#f #f #t)

(define l< (make-list-comparator <))

(sort '((1 3 5) (1 2 6)) l<)		; => ((1 2 6) (1 3 5))
(sort '((1 2 5) (1 2 6)) l<)		; => ((1 2 5) (1 2 6))
(sort '((1 3) (1 2 6)) l<)		; => ((1 2 6) (1 3))
(sort '((1 2) (1 2 6)) l<)		; => ((1 2) (1 2 6))

(unfoldL (lambda (a b) (> (+ a b) 10))
	 (lambda (a b) (/ a b))
	 (lambda (a b) (list (+ a 1) (+ b 1/2)))
	 (list 1 1))

;; => (1 4/3 3/2 8/5 5/3 12/7)

(iotaR 0 5)				; => (0 1 2 3 4)
(iotaR 4 5)				; => (4)
